package com.leyou.item.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

@Data
public class SpuDTO {
    private Long id;
    private String name;
    private String subTitle;
    private Long cid1;
    private Long cid2;
    private Long cid3;
    private Long brandId;
    private Boolean saleable;
    private Date createTime;

    private String categoryName;
    private String brandName;

    private SpuDetailDTO spuDetail;
    private List<SkuDTO> skus;

    @JsonIgnore  //忽略这个get方法,避免将其序列化到Json结果中
    public List<Long> getCategoryIds() {
        return Arrays.asList(cid1, cid2, cid3);
    }
}
